<template>
  <div class="topnav">
    <!--  <img class="logoImg" src="../../public/img/maomi.svg">-->

    <el-menu
        class="el-menu-demo"
        mode="horizontal"
        background-color="white"
        text-color="#fff"
        active-text-color="#ffd04b">
      <!-- <el-select v-model="value" placeholder="请选择" class="select" size="mini">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value">
        </el-option>
      </el-select> -->

      <!-- <el-checkbox v-model="hideNo" @change="noClick">是否隐藏题号</el-checkbox> -->
      <el-button type="primary" round size="mini" class="button" @click="preSight">预览</el-button>
      <el-button type="primary" round size="mini" class="button" @click="finish">完成编辑</el-button>
    </el-menu>

  </div>

</template>

<script>

export default {
  name: 'Topnav',
  data() {
    return {
      check: false,
      options: [{
        value: '1',
        label: '不设置  '
      }, {
        value: '2',
        label: '按题目随机'
      }],
      value: '1',
    };
  },
  emits: ['noClick','leave'],
  methods: {
    noClick() {
      this.$emit('noClick')
    },
    preSight() {
      const { href } = this.$router.resolve({
        path: '/fill/preSight/card',
        query: {
          questionnaireId: this.questionnaireId,
        }
      });
      window.open(href,'_blank')
    },
    finish() {
      this.$emit('leave')
    }
  },
  props: {
    hideNo: {
      type: Boolean,
      default: false,
    },
    questionnaireId: {
      type: Number,
      default: 0,
    }
  }
}
</script>

<style scoped src='assets/css/editcss/topnav.css'>

  /* @import url('./cs?s/topnav.css'); */
</style>
